<template>
  <div>
    <el-form
      :inline="true"
      :model="data"
      size="small"
      class="demo-form-inline"
    >
      <el-form-item label="名称">
        <el-input v-model="data.searchKey" clearable placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item label="类型">
        <el-select v-model="data.type" clearable filterable placeholder="请选择">
          <el-option label="金额券" :value="1"></el-option>
          <el-option label="折扣券" :value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="状态">
        <el-select v-model="data.enabled" clearable filterable placeholder="请选择">
          <el-option label="启用" :value="1"></el-option>
          <el-option label="禁用" :value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="onSubmit">搜索</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
      default() {
        return {
          searchKey: null,
          type: null,
          enabled: null
        }
      }
    }
  },
  methods: {
    onSubmit() {
      this.$emit('search')
    },
  },
};
</script>

<style lang="sass" scoped>
</style>